import 'package:flutter/material.dart';

class NovelDetailBottomButton extends StatelessWidget {
  const NovelDetailBottomButton({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    var rwidth = MediaQuery.of(context).size.width;
    var width = rwidth * 0.33;
    var btnwidth = width - 30;
    var readbtnwidth = rwidth - (btnwidth * 2) - 10;

    return Positioned(
        bottom: 0,
        child: Container(
          width: MediaQuery.of(context).size.width,
          padding: EdgeInsets.all(5.0),
          height: 65.0,
          decoration: BoxDecoration(
            color: Colors.white,
              border: Border(top: BorderSide(color: Colors.grey))),
          child: Row(
            mainAxisAlignment: MainAxisAlignment.spaceBetween,
            children: [
              Container(
                width: btnwidth,
                child: Column(children: [
                  Icon(Icons.add, color: Colors.redAccent),
                  Text('加入书架', style: TextStyle(color: Colors.grey.shade600))
                ]),
              ),
              Container(
                  width: btnwidth,
                  child: Column(children: [
                    Icon(Icons.download_done),
                    Text(
                      '缓存下载',
                      style: TextStyle(color: Colors.grey.shade600),
                    )
                  ])),
              GestureDetector(
                  onTap: () {},
                  child: Container(
                      width: readbtnwidth,
                      decoration:
                          BoxDecoration(color: Colors.redAccent.shade400),
                      child: Center(
                          child: Text(
                        '立即阅读',
                        style: TextStyle(color: Colors.white),
                      ))))
            ],
          ),
        ));
  }
}
